﻿@page
@using Microsoft.AspNetCore.Authorization
@using Snow.Hcm.Localization;
@using Snow.Hcm.Web.Pages.Employees;
@using Microsoft.Extensions.Localization
@using Snow.Hcm.Permissions
@using Snow.Hcm.Web.Menus
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model IndexModel
@inject IStringLocalizer<HcmResource> L
@inject IAuthorizationService Authorization
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["Employees"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:Employees"].Value);
    PageLayout.Content.MenuItemName = HcmMenus.Employees;
}
@section styles {
    <abp-style-bundle name="@typeof(IndexModel).FullName">
        <abp-style src="/libs/select2-bootstrap4-theme/select2-bootstrap4.min.css" />
        <abp-style src="/libs/select2/css/select2.min.css" rel="stylesheet" />
        <abp-style src="/libs/daterangepicker/daterangepicker.css" />
    </abp-style-bundle>
}
@section scripts
{
    <abp-script-bundle name="@typeof(IndexModel).FullName">
        <abp-script src="/libs/moment/min/moment.min.js" />
        @*<abp-script src="/libs/moment/min/moment-with-locales.min.js" />
        <abp-script src="/libs/moment/locale/zh-cn.js" />*@
        <abp-script src="/libs/daterangepicker/daterangepicker.js" />
        <abp-script src="/libs/select2/js/select2.min.js" />
        <abp-script src="/Pages/Employees/Index.js" />
        <abp-script src="/js/common.js" />
        <abp-script src="/Pages/Employees/CreateModal.js" />
        @*<abp-script src="/Pages/Employees/Edit.js" />*@
    </abp-script-bundle>
}
<abp-card id="EmployeesWrapper">
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <abp-card-title>@L["Employees"]</abp-card-title>
            </abp-column>
            <abp-column size-md="_6" class="text-right">
                @if (await Authorization.IsGrantedAsync(HcmPermissions.Employees.Create))
                {
                    <abp-button name="CreateEmployee"
                                text="@L["NewEmployee"].Value"
                                icon="plus"
                                button-type="Primary" />
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="EmployeesTable"></abp-table>
    </abp-card-body>
</abp-card>